/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  							 script_display_text.h

	$Header: /heroes4/script_display_text.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( SCRIPT_DISPLAY_TEXT_H_INCLUDED )
#define SCRIPT_DISPLAY_TEXT_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <iosfwd>
#include <string>

#include "script_sequence.h"
#include "counted_ptr.h"

class t_basic_dialog;

// --------------------------------------------------------------------------
// t_script_display_text class
// --------------------------------------------------------------------------

class t_script_display_text : public t_script_sequence
{
public:
	// Member functions

	virtual	void execute(t_script_context_hero const& context) const;
	virtual void execute(t_script_context_town const& context) const;
	virtual void execute(t_script_context_object const& context) const;
	virtual void execute(t_script_context_army const& context) const;
	virtual void execute(t_script_context_global const& context) const;

	virtual void executed_subaction(const t_subaction& subaction) const;

	std::string const &	get_text() const;

	virtual bool		read( std::streambuf& stream, int version);
	virtual bool		read_from_map(
							std::streambuf &	string,
							int					format_version );
	virtual bool		write( std::streambuf& stream ) const;


private:
	// Data members
	std::string						m_text;

	void execute_dialog(t_basic_dialog* dialog) const;
};

// --------------------------------------------------------------------------
// t_script_display_text inline members
// --------------------------------------------------------------------------

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
inline std::string const & t_script_display_text::get_text() const
{
	return m_text;
}

SPECIALIZE_SCRIPT_ACTION( k_script_action_display_text, t_script_display_text );

#endif // !defined( SCRIPT_DISPLAY_TEXT_H_INCLUDED )
